from odoo import api, fields, models, _


class Scheme(models.Model):
    _name = 'check.scheme'
    _description = "计费方案"


    scheme_id = fields.Char(
        '方案编号',
        default="10001"
    )

    name = fields.Char(
        '方案名称',
    )

    deposites = fields.Monetary(
        '预缴押金',
        'currency_id',
    )

    currency_id = fields.Many2one(
        'res.currency',
        default=lambda self: self.env.user.company_id.currency_id,
        )  # price helper

    period = fields.Selection(
        [
            ("i".format(i), i)for i in range(1, 99)
        ], string="计费周期(天)", default="30",
    )

    unit_price = fields.Monetary(
        '预设单价',
        'currency_id'
    )

    currency_id = fields.Many2one(
        'res.currency',
         default = lambda self: self.env.user.company_id.currency_id,
    )  # price helper

    addition = fields.Selection(
        [
            ('0', '追加自定义费用'),
            ('1', '每超出一天追加')
        ],
        string='逾期追加', default='0'
    )

    note = fields.Char(
        "备注信息"
    )
